const http = (obj)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			// 平台编译
			//#ifndef MP-WEIXIN
			// url:'/api' +obj.url,
			url:'http://localhost:3000' +obj.url,
			//#endif
			//#ifdef MP-WEIXIN
			url:'http://localhost:3000'+obj.url,
			//#endif
			method:obj.method || 'GET',
			data:obj.data || {},
			header:obj.header || {'content-type':'application/json'},
			success(res){
				resolve(res)
			},
			file(error){
				reject(error)
			}
		})
	 })
}
export default http